//
//  ViewController.swift
//  emoji
//
//  Created by SteveLi on 2017/10/26.
//  Copyright © 2017年 李军桦. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        //16进制字符串
        let str = "0x1f603"
        print(str.emoji)
    }
    func demo(){
        //16进制字符串
        let str = "0x1f603"
        //文本扫描器 -- 扫描指定格式的字符串
        let scanerss = Scanner(string: str)
        //unicode的值
        var value: UInt32 = 0
        scanerss.scanHexInt32(&value)
        print(value)
        //转换 unicide 字符
        let chr = UnicodeScalar(UnicodeScalar(value)!)
        print(chr)
        
        //装换成字符串
        let result = "\(chr)"
        print(result)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

